home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 24 / CU Amiga Magazine's Super CD-ROM 24 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-07].iso / CUCD / Utilities / vim-5.1 / src / testdir / test3.ok < prev    next >
Encoding:
Text File  |  1998-03-08  |  6.2 KB  |  611 lines

  1.  
  2. /* start of AUTO matically checked */
  3. {
  4.     if (test)
  5.         cmd1;
  6.     cmd2;
  7. }
  8.  
  9. {
  10.     if (test)
  11.         cmd1;
  12.     else
  13.         cmd2;
  14. }
  15.  
  16. {
  17.     if (test)
  18.     {
  19.         cmd1;
  20.         cmd2;
  21.     }
  22. }
  23.  
  24. {
  25.     if (test)
  26.     {
  27.         cmd1;
  28.         else
  29.     }
  30. }
  31.  
  32. {
  33.     while (this)
  34.         if (test)
  35.             cmd1;
  36.     cmd2;
  37. }
  38.  
  39. {
  40.     while (this)
  41.         if (test)
  42.             cmd1;
  43.         else
  44.             cmd2;
  45. }
  46.  
  47. {
  48.     if (test)
  49.     {
  50.         cmd;
  51.     }
  52.  
  53.     if (test)
  54.         cmd;
  55. }
  56.  
  57. {
  58.     if (test) {
  59.         cmd;
  60.     }
  61.  
  62.     if (test) cmd;
  63. }
  64.  
  65. {
  66.     cmd1;
  67.     for (blah)
  68.         while (this)
  69.             if (test)
  70.                 cmd2;
  71.     cmd3;
  72. }
  73.  
  74. {
  75.     cmd1;
  76.     for (blah)
  77.         while (this)
  78.             if (test)
  79.                 cmd2;
  80.     cmd3;
  81.  
  82.     if (test)
  83.     {
  84.         cmd1;
  85.         cmd2;
  86.         cmd3;
  87.     }
  88. }
  89.  
  90.  
  91. /* Test for 'cindent' do/while mixed with if/else: */
  92.  
  93. {
  94.     do
  95.         if (asdf)
  96.             asdfasd;
  97.     while (cond);
  98.  
  99.     do
  100.         if (asdf)
  101.             while (asdf)
  102.                 asdf;
  103.     while (asdf);
  104. }
  105.  
  106. /* Test for 'cindent' with two ) on a continuation line */
  107. {
  108.     if (asdfasdf;asldkfj asdlkfj as;ldkfj sal;d
  109.             aal;sdkjf  ( ;asldfkja;sldfk
  110.                 al;sdjfka ;slkdf ) sa;ldkjfsa dlk;)
  111.         line up here;
  112. }
  113.  
  114.  
  115. /* C++ tests: */
  116.  
  117. // foo()        these three lines should remain in column 0
  118. // {
  119. // }
  120.  
  121. /* Test for continuation and unterminated lines: */
  122. {
  123.     i = 99 + 14325 +
  124.         21345 +
  125.         21345 +
  126.         21345 + ( 21345 +
  127.                 21345) +
  128.         2345 +
  129.         1234;
  130.     c = 1;
  131. }
  132.  
  133. /*
  134.    testje for indent with empty line
  135.  
  136.    here */
  137.  
  138. {
  139.     if (testing &&
  140.             not a joke ||
  141.             line up here)
  142.         hay;
  143.     if (testing &&
  144.             (not a joke || testing
  145.             )line up here)
  146.         hay;
  147.     if (testing &&
  148.             (not a joke || testing
  149.              line up here))
  150.         hay;
  151. }
  152.  
  153.  
  154. {
  155.     switch (c)
  156.     {
  157.         case xx:
  158.             do
  159.                 if (asdf)
  160.                     do
  161.                         asdfasdf;
  162.                     while (asdf);
  163.                 else
  164.                     asdfasdf;
  165.             while (cond);
  166.         case yy:
  167.         case xx:
  168.         case zz:
  169.             testing;
  170.     }
  171. }
  172.  
  173. {
  174.     if (cond) {
  175.         foo;
  176.     }
  177.     else
  178.     {
  179.         bar;
  180.     }
  181. }
  182.  
  183. {
  184.     if (alskdfj ;alsdkfjal;skdjf (;sadlkfsa ;dlkf j;alksdfj ;alskdjf
  185.                 alsdkfj (asldk;fj
  186.                     awith cino=(0 ;lf this one goes to below the paren with ==
  187.                         ;laksjfd ;lsakdjf ;alskdf asd)
  188.                     asdfasdf;)))
  189.         asdfasdf;
  190. }
  191.  
  192.     int
  193. func(a, b)
  194.     int a;
  195.     int c;
  196. {
  197.     if (c1 && (c2 ||
  198.                 c3))
  199.         foo;
  200.     if (c1 &&
  201.             (c2 || c3)
  202.        )
  203. }
  204.  
  205. {
  206.     while (asd)
  207.     {
  208.         if (asdf)
  209.             if (test)
  210.                 if (that)
  211.                 {
  212.                     if (asdf)
  213.                         do
  214.                             cdasd;
  215.                         while (as
  216.                                 df);
  217.                 }
  218.                 else
  219.                     if (asdf)
  220.                         asdf;
  221.                     else
  222.                         asdf;
  223.         asdf;
  224.     }
  225. }
  226.  
  227. {
  228.     s = "/*"; b = ';'
  229.         s = "/*"; b = ';';
  230.     a = b;
  231. }
  232.  
  233. {
  234.     switch (a)
  235.     {
  236.         case a:
  237.             switch (t)
  238.             {
  239.                 case 1:
  240.                     cmd;
  241.                     break;
  242.                 case 2:
  243.                     cmd;
  244.                     break;
  245.             }
  246.             cmd;
  247.             break;
  248.         case b:
  249.             {
  250.                 int i;
  251.                 cmd;
  252.             }
  253.             break;
  254.         case c: {
  255.                     int i;
  256.                     cmd;
  257.                 }
  258.         case d: if (cond &&
  259.                         test) {        /* this line doesn't work right */
  260.                     int i;
  261.                     cmd;
  262.                 }
  263.                 break;
  264.     }
  265. }
  266.  
  267. {
  268.     if (!(vim_strchr(p_cpo, CPO_BUFOPTGLOB) != NULL && entering) &&
  269.             (bp_to->b_p_initialized ||
  270.              (!entering && vim_strchr(p_cpo, CPO_BUFOPT) != NULL)))
  271.         return;
  272. label :
  273.     asdf = asdf ?
  274.         asdf : asdf;
  275.     asdf = asdf ?
  276.         asdf: asdf;
  277. }
  278.  
  279. /* Special Comments    : This function has the added complexity (compared  */
  280. /*                    : to addtolist) of having to check for a detail     */
  281. /*                    : texture and add that to the list first.             */
  282.  
  283. char *(array[100]) = {
  284.     "testje",
  285.     "foo",
  286.     "bar",
  287. }
  288.  
  289. {
  290.     struct Type
  291.     {
  292.         int i;
  293.         char *str;
  294.     } var[] =
  295.     {
  296.         0, "zero",
  297.         1, "one",
  298.         2, "two",
  299.         3, "three"
  300.     };
  301.  
  302.     float matrix[3][3] =
  303.     {
  304.         {
  305.             0,
  306.             1,
  307.             2
  308.         },
  309.         {
  310.             3,
  311.             4,
  312.             5
  313.         },
  314.         {
  315.             6,
  316.             7,
  317.             8
  318.         }
  319.     };
  320. }
  321.  
  322. {
  323.     /* blah ( blah */
  324.     /* where does this go? */
  325.  
  326.     /* blah ( blah */
  327.     cmd;
  328.  
  329.     func(arg1,
  330.             /* comment */
  331.             arg2);
  332.     a;
  333.     {
  334.         b;
  335.         {
  336.             c; /* Hey, NOW it indents?! */
  337.         }
  338.     }
  339.  
  340.     {
  341.         func(arg1,
  342.                 arg2,
  343.                 arg3);
  344.         /* Hey, what am I doing here?  Is this coz of the ","? */
  345.     }
  346. }
  347.  
  348. main ()
  349. {
  350.     if (cond)
  351.     {
  352.         a = b;
  353.     }
  354.     if (cond) {
  355.         a = c;
  356.     }
  357.     if (cond)
  358.         a = d;
  359.     return;
  360. }
  361.  
  362. {
  363.     case 2: if (asdf &&
  364.                     asdfasdf)
  365.                 aasdf;
  366.             a = 9;
  367.     case 3: if (asdf)
  368.                 aasdf;
  369.             a = 9;
  370.     case 4:    x = 1;
  371.                y = 2;
  372.  
  373. label:    if (asdf)
  374.             here;
  375.  
  376. label:  if (asdf &&
  377.                 asdfasdf)
  378.         {
  379.         }
  380.  
  381. label:  if (asdf &&
  382.                 asdfasdf) {
  383.             there;
  384.         }
  385.  
  386. label:  if (asdf &&
  387.                 asdfasdf)
  388.             there;
  389. }
  390.  
  391. {
  392.     /*
  393.        hello with ":set comments= cino=c5"
  394.      */
  395.  
  396.     /*
  397.        hello with ":set comments= cino="
  398.      */
  399. }
  400.  
  401.  
  402. {
  403.     if (a < b) {
  404.         a = a + 1;
  405.     } else
  406.         a = a + 2;
  407.  
  408.     if (a)
  409.         do {
  410.             testing;
  411.         } while (asdfasdf);
  412.     a = b + 1;
  413.     asdfasdf
  414. }
  415.  
  416. class bob
  417. {
  418.     int foo() {return 1;}
  419.     int bar;
  420. }
  421.  
  422. main()
  423. {
  424.     while(1)
  425.         if (foo)
  426.         {
  427.             bar;
  428.         }
  429.         else {
  430.             asdf;
  431.         }
  432.     misplacedline;
  433. }
  434.  
  435. {
  436.     if (clipboard.state == SELECT_DONE
  437.             && ((row == clipboard.start.lnum
  438.                     && col >= clipboard.start.col)
  439.                 || row > clipboard.start.lnum))
  440. }
  441.  
  442. /* end of AUTO */
  443.  
  444. STARTTEST
  445. :set tw=0 wm=60 columns=80 noai fo=croq
  446. /serious/e
  447. a about life, the universe, and the rest
  448. ENDTEST
  449.  
  450. {
  451.  
  452. /* this is
  453.  * a real serious
  454.  * about life, the
  455.  * universe, and the
  456.  * rest important big
  457.  * comment
  458.  */
  459.     /* insert " about life, the universe, and the rest" after "serious" */
  460. }
  461.  
  462. STARTTEST
  463. :set nocin
  464. /comments
  465. joabout life/happens
  466. jothere/below
  467. oline/this
  468. Ohello
  469. ENDTEST
  470.  
  471. {
  472.     /*
  473.      * Testing for comments, without 'cin' set
  474.      */
  475. about life
  476.  
  477. /*
  478. * what happens here?
  479. */
  480. there
  481.  
  482.     /*
  483.        the end of the comment, try inserting a line below */
  484. line
  485.  
  486.         /* how about
  487. hello
  488.                         this one */
  489. }
  490.  
  491. STARTTEST
  492. :set cin
  493. /vec2
  494. ==
  495. ENDTEST
  496.  
  497. {
  498.     var = this + that + vec[0] * vec[0]
  499.                       + vec[1] * vec[1]
  500.                       + vec2[2] * vec[2];
  501. }
  502.  
  503. STARTTEST
  504. :set cin
  505. :set cino=}4
  506. /testing1
  507. k2==/testing2
  508. k2==
  509. ENDTEST
  510.  
  511. {
  512.         asdf asdflkajds f;
  513.     if (tes & ting) {
  514.         asdf asdf asdf ;
  515.         asdfa sdf asdf;
  516.         }
  517.     testing1;
  518.     if (tes & ting)
  519.     {
  520.         asdf asdf asdf ;
  521.         asdfa sdf asdf;
  522.         }
  523.     testing2;
  524. }
  525.  
  526. STARTTEST
  527. :set cin
  528. :set cino=(0,)20
  529. /main
  530. =][
  531. ENDTEST
  532.  
  533. main ( int first_par, /*
  534.                        * Comment for
  535.                        * first par
  536.                        */
  537.        int second_par /*
  538.                        * Comment for
  539.                        * second par
  540.                        */
  541.      )
  542. {
  543.     func( first_par, /*
  544.                       * Comment for
  545.                       * first par
  546.                       */
  547.           second_par /*
  548.                       * Comment for
  549.                       * second par
  550.                       */
  551.         );
  552.  
  553. }
  554.  
  555. STARTTEST
  556. :set cin
  557. :set cino=
  558. ]]=][
  559. ENDTEST
  560.  
  561. {
  562.     do
  563.     {
  564.         if ()
  565.         {
  566.             if ()
  567.                 asdf;
  568.             else
  569.                 asdf;
  570.         }
  571.     } while ();
  572.     cmd;        /* this should go under the } */
  573. }
  574.  
  575. STARTTEST
  576. ]]=][
  577. ENDTEST
  578.  
  579. void f()
  580. {
  581.     if ( k() ) {
  582.         l();
  583.  
  584.     } else { /* Start (two words) end */
  585.         m();
  586.     }
  587.  
  588.     n();
  589. }
  590.  
  591. STARTTEST
  592. /while
  593. ohere
  594. ENDTEST
  595.  
  596. a()
  597. {
  598.   do {
  599.     a = a +
  600.       a;
  601.   } while ( a );        /* add text under this line */
  602.   here
  603.     if ( a )
  604.       a;
  605. }
  606.  
  607. STARTTEST
  608. :1;/ENDTEST/+1,$wq! test.out
  609. ENDTEST
  610.  
  611.